#pragma once

class Bone;

class XmlNode;

class BoneInfo
{
public:
	BoneInfo(void);
	~BoneInfo(void);

public:
	void LoadFromXml( XmlNode * boneInfoNode );

public:
	Bone * GetBoneByName( std::string name );
	Bone * GetBoneByIndex( int index );

public:
	int GetBoneCount()	{ return (int)m_boneArray.size(); }

public:
	void Update();

private:
	void InsertBoneFromXml( Bone * parentBone,  XmlNode * boneNode  );

	void InsertRootBone();
	void InsertBone( Bone * bone );

	void FillBoneData();

private:
	Bone * m_rootBone;

	std::vector<Bone*> m_boneArray;
	std::map<std::string, Bone*> m_boneMap;
};
